﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class idsort : IComparer<student2>
    {
        public int Compare(student2 x, student2 y)
        {
            return x.id.CompareTo(y.id);
        }
    }
    class agesort : IComparer<student2>
    {
        public int Compare(student2 x, student2 y)
        {
            return x.age.CompareTo(y.age);
        }
    }
    class namesort : IComparer<student2>
    {
        public int Compare(student2 x, student2 y)
        {
            return x.name.CompareTo(y.name);
        }
    }
    class student2:IComparer<student2>
    {
        public int id { get; set; }
        public string name { get; set; }

        public int age { get; set; }

        public student2() { 
        
        
        }
        public student2(int id, string name,int age) {
            this.name = name;
            this.id = id;
            this.age = age;
        
        }

        public int Compare(student2 x, student2 y)
        {
            throw new NotImplementedException();
        }
        public override string ToString()
        {
            return $"学号：{id}姓名：{name}年龄：{age}";
        }
    }
}
